const getWeather = require('./getWeather');
const utils = require('util');
const request = utils.promisify(require('request'));
const url = 'https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=eefb5ba8-77f3-4538-8030-bfa52bb661f2';

getWeather().then((msg) => {
  const sendJson = {
    'msgtype': 'text',
    'text': {
      'content': msg,
      'mentioned_list': ['@all']
      // 'mentioned_mobile_list': ['123']
    }
  };
  return request({
    url: url,
    method: 'POST',
    json: true,
    body: sendJson
  });
}).then((body) => {
  console.log('成功！');
});
